<!DOCTYPE html PUBLIC "-//W3C//Dtd XHTML 1.0 Transitional//EN" "http://www.w3.org/tr/xhtml1/Dtd/xhtml1-transitional.dtd">
<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<%@ page import="com.infodms.dms.common.Constant" %>
<%@ page import="java.util.Map" %>
<%
	String contextPath = request.getContextPath();
%>
<html xmlns="http://www.w3.org/1999/xhtml">
<%@taglib uri="/jstl/cout" prefix="c" %>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<jsp:include page="${contextPath}/common/jsp_head_new.jsp" />
<title>经销商维护</title>
<script type="text/javascript">
function doInit()
{  
	genLocSel('txt1','txt2','txt3','<c:out value="${map.PROVINCE_ID}"/>','<c:out value="${map.CITY_ID}"/>','<c:out value="${map.AREA_ID}"/>'); // 加载省份城市和县
}

</script>
</head>
<body>
<div class="navigation"><img src="<%=contextPath%>/img/nav.gif" />&nbsp;当前位置： 系统管理 &gt; 经销商管理 &gt;修改经销商地址</div>
 <form method="post" name = "fm" id="fm" >
 <input id="DEALER_ID" name="DEALER_ID" type="hidden" value="${dealerId}"/>
 <input id="ADDRESS_ID" name="ADDRESS_ID" type="hidden" value="<c:out value="${map.ID}"/>"/>
    <table width=100% border="0" align="center" cellpadding="1" cellspacing="1" class="table_query">
		  <tr>
		    <td class="table_query_2Col_label_6Letter">地址代码：</td>
		    <td><input type='text'  class="middle_txt" name="ADD_CODE"  id="ADD_CODE" datatype="0,is_name,30"  value="<c:out value="${map.ADD_CODE}"/>" maxlength="30"/>
		    </td>
		    <td class="table_query_2Col_label_6Letter">地址名称：</td>
		    <td>
		    <input type='text'  class="middle_txt" name="ADDRESS"  id="ADDRESS" datatype="0,is_null,150"  value="<c:out value="${map.ADDRESS}"/>" maxlength="150"/>
		    </td>
	      </tr>
	      <tr>
		    <td class="table_query_2Col_label_6Letter">联系人：</td>
		    <td>
		    <input type='text'  class="middle_txt" name="linkMan"  id="linkMan" datatype="1,is_name,8"  value="<c:out value="${map.LINK_MAN}"/>" maxlength="8"/>
		    </td>
		    <td class="table_query_2Col_label_6Letter">电话：</td>
		    <td>
		    <input type='text'  class="middle_txt" name="tel"  id="tel" datatype="1,is_null,30"  value="<c:out value="${map.TEL}"/>" maxlength="30"/>
		    </td>
	     </tr>
	     <tr>
		    <td class="table_query_2Col_label_6Letter">地址状态：
		    </td>
		    <td>
		   <label>
				<script type="text/javascript">
					genSelBoxExp("ADDRESSSTATUS",<%=Constant.STATUS%>,"<c:out value="${map.STATUS}"/>",'',"short_sel",'',"false",'');
				</script>
		  </label>
		    </td>
		    <td class="table_query_2Col_label_6Letter">收货单位：</td>
		    <td>
		    <input type='text'  class="middle_txt" name="myaddress"  id="myaddress" datatype="1,is_null,15"  value="<c:out value="${map.RECEIVE_ORG}"/>" maxlength="15"/>
		    </td>
	     </tr>
	     <tr>
	     	<td class="table_query_2Col_label_6Letter">省份：</td>
	      <td><select class="min_sel" id="txt1" name="province" onchange="_genCity(this,'txt2')"></select> </td>
         	<td class="table_query_2Col_label_6Letter">地级市：</td>
	      <td><select class="min_sel" id="txt2" name="city"  onchange="_genCity(this,'txt3')" ></select></td>  
	     </tr>
	     <tr>
	     <td class="table_query_2Col_label_6Letter">县：</td>
	      <td><select class="min_sel" id="txt3" name="area" ></select></td>
	     </tr>
	      <tr>
	        <td class="table_query_2Col_label_6Letter">备注：</td>
	      	<td><textarea name="remark" id="remark" cols="40" rows="2" datatype="1,is_textarea,1000"><c:out value="${map.REMARK}"/></textarea></td>
	      </tr>
     </table> 
     <table class=table_query>
	 <tr>
	 <td>
	<input type="button" value="修改" name="saveBtn" class="normal_btn" onclick="modifyAddress()"/>	
	<input type="button" value="关闭" name="cancelBtn"  class="normal_btn" onclick="_hide();" /></td>
	</tr>
   </table>
</form>

<script type="text/javascript" >
function modifyAddress()
{
	var province = $('province').value;
	var city = $('city').value;
	var area = $('area').value;
	if(province==''){
		alert('必须填写省份！');
		return;
	}
	if(city==''){
		alert('必须填写地级市！');
		return;
	}
	if(area==''){
		alert('必须填写区县！');
		return;
	}
	if(submitForm('fm'))
	{
	 if(confirm("确认修改吗？"))
		{
			 toSubmit();
		}
	} 
}
function toSubmit(){
	makeNomalFormCall('<%=contextPath%>/sysmng/dealer/DealerInfo/modifyAddressInfo.json',showResult,'fm');
}
//回调方法
function showResult(json){
	if(json.returnValue == '1'){
		parent.$('inIframe').contentWindow.parentMonth();
	 	_hide();
	}else{
		windows.parent.MyAlert("操作失败！请联系系统管理员！");
	}
}
</script>

</body>
</html>
